package uiux4.helloandroid;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SubActivity extends Activity implements OnClickListener {

	EditText et;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_sub);
		
		et = (EditText)findViewById(R.id.findStr);
		Button btn = (Button)findViewById(R.id.findBtn);
		btn.setOnClickListener(this);
		
	}
	
	@Override
	public void onClick(View view) {
		String str = et.getText().toString();
		Toast.makeText(getApplicationContext(), str, Toast.LENGTH_SHORT).show();;
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.sub, menu);
		return true;
	}

}
